<template>
  <div class="box" style="
  position: absolute;
  bottom:10px;
  left:10px;
  border-radius: 10px;
  width:270px;
  height:260px;
  padding: 20px;
  background-color:white;
  box-shadow: 0 2px 10px rgba(0, 145, 255, 0.3);

  
  ">
    <div class="data-statistics-title" style="width:100%;
                                              font-size: 20px;
                                              margin-bottom:40px;
                                              
    ">
      <span style="float:left;">平台单车数据统计</span> <i style="float:right; color:#bfbfbf;cursor: pointer;"
        @click="handlerClose" class="el-icon-error"></i>
    </div>
    <div>
      <el-cascader style="display:block; margin-bottom:20px;" size="large" :options="options" v-model="selectedOptions"
        @change="handleChange">
      </el-cascader>
      <div class="list-plateform" style="overflow-y:scroll;overflow-x:hidden;height:150px;">
        <plateform-view v-for="(item, index) in dataPlateforms" :avatar="item.avatar" :percentage="item.percentage"
          :type="item.type" :key="index"></plateform-view>
      </div>
    </div>
  </div>
</template>

<script>
import { regionData } from 'element-china-area-data'
import PlateformView from '@/components/data-source/item/PlateformView.vue'
export default {
  data() {
    return {
      options: regionData,
      selectedOptions: [],
      dataPlateforms: [
        {
          avatar: '/img/mine/def_img.jpg',
          percentage: 75,
          type: 'primary'
        },
        {
          avatar: '/img/mine/def_img.jpg',
          percentage: 30,
          type: 'primary'
        },
        {
          avatar: '/img/mine/def_img.jpg',
          percentage: 21,
          type: 'primary'
        },
        {
          avatar: '/img/mine/def_img.jpg',
          percentage: 18,
          type: 'primary'
        },
      ]
    }
  },
  components: {
    PlateformView
  },
  methods: {
    handleChange(value) {
      console.log(value)
    },
    //绑定自定义的关闭事件
    handlerClose() {
      // 在子组件中触发自定义事件 'custom-event'
      this.$emit('has-closed', 'true');
    }
  }
}
</script>

<style scoped>
</style>